package com.zx.方案学习.cpt_1_jdk;

public class Task1 {

	/**
	 * @Title: 以线程的方式运行一个任务
	 * @param args
	 * @date: 2020年3月8日下午9:35:19
	 * @author: zhangxue
	 */
	public static void main(String[] args) {
		final long timeInterval = 1000;
		Runnable runnable = new Runnable() {
			public void run() {
				while (true) {
					System.out.println("Hello !!");
					try {
						Thread.sleep(timeInterval);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		};
		Thread thread = new Thread(runnable);
		thread.start();
	}

}
